#define _CRT_SECURE_NO_WARNINGS 1


#include <math.h>
int* findDisappearedNumbers(int* nums, int numsSize, int* returnSize) {
    for (int i = 0; i < numsSize; ++i)
    {
        if (abs(nums[i]) - 1 >= 0 && abs(nums[i]) - 1 < numsSize && nums[abs(nums[i]) - 1] > 0)
        {
            nums[abs(nums[i]) - 1] *= -1;
        }
    }
    int* arr = (int*)malloc(sizeof(int) * numsSize);
    *returnSize = 0;
    for (int i = 0; i < numsSize; ++i)
    {
        if (nums[i] > 0)
        {
            arr[(*returnSize)++] = i + 1;
        }
    }
    return arr;
}